package com.powernobug.servlet;

import com.powernobug.bean.vo.BaseRespVo;
import com.powernobug.bean.vo.data.DashboardData;
import com.powernobug.service.AdminDashboardService;
import com.powernobug.service.impl.AdminDashboardServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author: 肖云戈
 * @CreateTime: 2024-08-20
 * @Description:
 */
@WebServlet("/dashboard")
public class AdminDashboardServlet extends CommonServlet{
    private static AdminDashboardService adminDashboardService = new AdminDashboardServiceImpl();

    public BaseRespVo dashboard(HttpServletRequest req) {
        // req中没有查询所需的参数，直接查询并返回数据即可
        DashboardData dashboardData = adminDashboardService.statistic();
        return BaseRespVo.okList(dashboardData);
    }
}
